<template>
    <swiper>
      <SwiperItem v-for="(item, index) in banner" :key="index">
        <a :href="item.link" class="swiper_a">
          <img :src="item.image" alt="" @load="imageLoad" />
        </a>
      </SwiperItem>
    </swiper>
</template>

<script>
import { Swiper, SwiperItem } from "../../../components/common/swiper";
export default {
  props: {
    banner: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  data () {
    return {
      isLoad: false
    }
  },
  components: {
    Swiper,
    SwiperItem
  },
  methods: {
    imageLoad() {
      if(!this.isLoad) {
        this.$emit('swiperImageLoad')
        this.isLoad = true
      }
    }
  }
};
</script>

<style>
    .swiper_a img {
        width: 100%;
    }
</style>